/* eslint-disable node/no-missing-require */

require('@mctech/dp-impala-enhanced')
const { mountAll } = require('@mctech/koa-mount-api')

const { defineModels, paramsConfig } = require('@lib/sequelize')
const modules = require('./modules')

function mountResources (config, service) {
  defineModels(config, modules.Models)
  service.use(mountAll(modules.apis))

  // 读取参数配置项..
  const params = config.getConfig('paramsConfig')
  for (const k in params) {
    paramsConfig[k] = params[k]
  }
}

module.exports = mountResources
